<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>find方法</title>
  </head>
  <body>
    <script type="text/javascript">
      var ary = [
        {
          id: 1,
          name: "张三",
        },
        {
          id: 2,
          name: "李四",
        },
        {
          id: 3,
          name: "窝嫩叠",
        },
        {
          id: 4,
          name: "田斌",
        },
      ];
		let star = ary.findIndex(i =>i.id === 2)
		console.log(star);
      //let arr = ary.find(i => i.id === 1)
      //console.log(arr);
    //   let arr = ary.find((i) => i.id === 3);
    //   console.log(arr);
      // let target = ary.find(item => item.id == 3);
      // console.log(target)
      // let arr = ary.find(i => i.id === 1)
      // console.log(arr);
    </script>
  </body>
</html>
